
#ifndef _MEMBER_BSCROLLAREA_H_
#define _MEMBER_BSCROLLAREA_H_

#include <BImage>
#include <BStyle>
#include <BScrollBar>
#include <BScrollArea>
#include "IAlignment.h"

#define area_member(scrollArea)	((member_BScrollArea*)((BScrollBar*)scrollArea)->_ptr)

namespace BWE
{
	class BWidget;
	class BScrollBar;

	class member_BScrollArea : public BObject
	{
		friend class BScrollArea;
	public:
		member_BScrollArea(BScrollArea* scrollArea);
		~member_BScrollArea();

		void adjustRects();
		Orientation adjustRealArea();
		void adjustScrollBar();
		void applyScrolling();

		void slotMouseLeaveVerticalScrollBar();
		void slotVerticalScrollValueChanged(BObject* object, const BValue& value);

		void slotMouseLeaveHorizontalScrollBar();
		void slotHorizontalScrollValueChanged(BObject* object, const BValue& value);

		BScrollArea*		boss;
		BPointf				areaScale;
		Align				areaAlign;
		BImageHolder		areaImage;
		BSizePolicy			areaPolicy;
		BSize				spreadSize;
		BRect				rawArea;
		BSize				hintSize;
		BRect				area;
		BSize				iconSize;
		BString				noneTips;
		bool				titleVisible;
		BMargin				titleMargin;
		int					titleSpace;
		int					titleSize;
		BStyleHolder		titleStyle;
		IAlignment			alignment;
		bool				autoTop;
		bool				autoLeft;
		bool				autoRight;
		bool				autoBottom;
		BSize				handleSize;

		bool				dirty;
		BRect				headerRect;
		bool				hoverTitle;
		float				scrollStep;
		ScrollHint			horScrollHint;
		ScrollHint			verScrollHint;
		BScrollBarHolder	horScrollBar;
		BScrollBarHolder	verScrollBar;
	};
}

#endif